package chartCraft;

import java.io.File;
import java.util.Observable;

public class SaveStateManager extends Observable {
	
	private boolean mIsBlank;
	private boolean mDirty;
	private File mCurrentDocument;
	
	public SaveStateManager(boolean isBlank) {
		mIsBlank = isBlank;
		mDirty = false;
		mCurrentDocument = null;
	}
	
	public void touch() {
		setChanged();
		notifyObservers();
	}
	
	public void resetCurrentDocument(File file) {
		mCurrentDocument = file;
		mDirty = false;
		
		setChanged();
		notifyObservers();
	}
	
	public File getCurrentDocument() {
		return mCurrentDocument;
	}
	
	public void setDirty(boolean flag) {
		mDirty = flag;
		mIsBlank = false;
		
		setChanged();
		notifyObservers();
	}
	
	public boolean isDirty() {
		return mDirty;
	}
	public boolean isBlank() {
		return mIsBlank;
	}
	
}
